HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-26-0-120 6.17.0-1009-aws #9~24.04.2-Ubuntu SMP Fri Mar 6 23:50:29 UTC 2026 x86_64
User: ubuntu (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/html/spion/storage/framework/views/3ede04891d45eb76b111b60dbcd17d8e.php
<?php echo $__env->make('admin.includes.datatable-axios-files', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

<?php $__env->startSection('title', 'Website Management'); ?>

<?php $__env->startSection('content_header'); ?>
    <h1>User Website</h1>
    
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <div class="card card-dark">
        <div class="card-header">
            <h3 class="card-title">Website Details</h3>
            <div class="card-tools">
                
            </div>
        </div>
        <div class="card-body">
            <div class="form-group">
                <label for="search">Search</label>
                <?php if (isset($component)) { $__componentOriginale5d826ae10df3aa87f8449f474c11664 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginale5d826ae10df3aa87f8449f474c11664 = $attributes; } ?>
<?php $component = JeroenNoten\LaravelAdminLte\View\Components\Form\Input::resolve(['id' => 'search_keyword','name' => 'search_keyword'] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('adminlte-input'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(JeroenNoten\LaravelAdminLte\View\Components\Form\Input::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'form-control','placeholder' => 'searching...']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginale5d826ae10df3aa87f8449f474c11664)): ?>
<?php $attributes = $__attributesOriginale5d826ae10df3aa87f8449f474c11664; ?>
<?php unset($__attributesOriginale5d826ae10df3aa87f8449f474c11664); ?>
<?php endif; ?>
<?php if (isset($__componentOriginale5d826ae10df3aa87f8449f474c11664)): ?>
<?php $component = $__componentOriginale5d826ae10df3aa87f8449f474c11664; ?>
<?php unset($__componentOriginale5d826ae10df3aa87f8449f474c11664); ?>
<?php endif; ?>
            </div>
            <div class="form-group">
                <label for="status">Status</label>
                <?php
                    $options = ['all' => 'All', 1 => 'Draft', 2 => 'Submitted', 3 => 'Unpublished', 4 => 'Published'];
                ?>
                <?php if (isset($component)) { $__componentOriginal377f5828c1076ae12e071b1688061877 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal377f5828c1076ae12e071b1688061877 = $attributes; } ?>
<?php $component = JeroenNoten\LaravelAdminLte\View\Components\Form\Select::resolve(['name' => 'status_filter','id' => 'status_filter'] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('adminlte-select'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(JeroenNoten\LaravelAdminLte\View\Components\Form\Select::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
                    <?php if (isset($component)) { $__componentOriginal1e9af52466c1670f554542c6e6d1a065 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal1e9af52466c1670f554542c6e6d1a065 = $attributes; } ?>
<?php $component = JeroenNoten\LaravelAdminLte\View\Components\Form\Options::resolve(['options' => $options,'selected' => 'all'] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('adminlte-options'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(JeroenNoten\LaravelAdminLte\View\Components\Form\Options::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal1e9af52466c1670f554542c6e6d1a065)): ?>
<?php $attributes = $__attributesOriginal1e9af52466c1670f554542c6e6d1a065; ?>
<?php unset($__attributesOriginal1e9af52466c1670f554542c6e6d1a065); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal1e9af52466c1670f554542c6e6d1a065)): ?>
<?php $component = $__componentOriginal1e9af52466c1670f554542c6e6d1a065; ?>
<?php unset($__componentOriginal1e9af52466c1670f554542c6e6d1a065); ?>
<?php endif; ?>
                 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal377f5828c1076ae12e071b1688061877)): ?>
<?php $attributes = $__attributesOriginal377f5828c1076ae12e071b1688061877; ?>
<?php unset($__attributesOriginal377f5828c1076ae12e071b1688061877); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal377f5828c1076ae12e071b1688061877)): ?>
<?php $component = $__componentOriginal377f5828c1076ae12e071b1688061877; ?>
<?php unset($__componentOriginal377f5828c1076ae12e071b1688061877); ?>
<?php endif; ?>
            </div>
            <div class="search-about-wrap">
                <div class="row">
                    <!-- append code -->
                </div>
            </div>
            <!-- Pagination -->
            <div class="pagination">
                <ul class="pagination justify-content-center">
                </ul>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('js'); ?>
    <script>
        $(document).ready(function() {
            function loadWebsites(page = 1) {
                let searchKeyword = $('#search_keyword').val();
                let statusFilter = $('#status_filter').val();
                let perPage = 5;

                $.ajax({
                    url: "<?php echo e(route('admin.users.website')); ?>",
                    type: "GET",
                    data: {
                        search_keyword: searchKeyword,
                        status_filter: statusFilter,
                        per_page: perPage,
                        page: page
                    },
                    beforeSend: function() {
                        $('.search-about-wrap .row').html('<p class="text-center">Loading...</p>');
                    },
                    success: function(response) {
                        updateWebsiteList(response.data);
                        updatePagination(response);

                    },
                    error: function() {
                        $('.search-about-wrap .row').html(
                            '<p class="text-center text-danger">Error fetching data.</p>');
                    }
                });
            }

            function updateWebsiteList(data) {
                let container = $('.search-about-wrap .row');
                container.html(''); // Clear previous data

                if (data.length === 0) {
                    container.append('<p class="text-center">No records found.</p>');
                } else {
                    data.forEach(function(item) {
                        let statusClass = 'status_' + (item.status_text || 'Unknown');
                        const logoUrl = item.logo ? '<?php echo e(asset('storage')); ?>/' + item.logo :
                            '<?php echo e(asset('storage/logos/default-logo.jpg')); ?>';

                        let lastSaved = item.last_saved || 'N/A';
                        let renewalDateHTML = item.renewal_date !== 'N/A' ?
                            `<p>Next Renewal Date: ${item.renewal_date}</p>` : '';

                        let websiteItem = `
                            <div class="col-lg-12">
                                <div class="website-item d-flex justify-content-between align-items-center p-3 mb-3 border">
                                    <div class="website_status ${statusClass}">
                                        <span>${item.status_text || 'Unknown'}</span>
                                    </div>
                                    <div class="website-info d-flex align-items-center">
                                        <img src="${logoUrl}" alt="Website Logo" class="ml-3" style="width: 50px; height: 50px; object-fit: cover;">
                                        <div class="center_text">
                                            <h6>
                                                ${item.name}                                               
                                            </h6>
                                            <h6>${item.email}</h6>
                                           <p>
                                                <a href="${item.domain_name ? 'http://' + item.domain_name : 'http://' + item.subdomain_preference}" target="_blank">
                                                    <i class="fas fa-globe"></i>
                                                    ${item.domain_name ? item.domain_name : item.subdomain_preference}
                                                </a>                                                
                                                <i class="far fa-copy ml-2 copy-link" data-url="${item.domain_name ? 'http://' + item.domain_name : 'http://' + item.subdomain_preference}" title="Copy to clipboard"></i>
                                            </p>
                                            <p>Last saved: ${lastSaved}</p>
                                             ${renewalDateHTML}
                                        </div>
                                    </div>
                                    <div class="website-actions">
                                        <a class="btn btn-success edit-user" href="<?php echo e(route('admin.users.website.edit')); ?>?website_id=${item.id}" >Edit</a>
                                        <a href="<?php echo e(route('admin.transactions.index')); ?>?website_id=${item.id}" class="btn btn-warning transaction-user" data-id="${item.id}">Transaction</a>
                                    </div>
                                </div>
                            </div>
                        `;
                        container.append(websiteItem);
                    });
                }
            }
            function updatePagination(response) {
                const paginationContainer = $('.pagination ul');
                paginationContainer.empty();

                // Previous Button
                if (response.current_page > 1) {
                    paginationContainer.append(`
                        <li class="page-item">
                            <a class="page-link" href="#" data-page="${response.current_page - 1}">
                                <i class="fas fa-angle-left"></i>
                            </a>
                        </li>
                    `);
                } else {
                    paginationContainer.append(`
                        <li class="page-item disabled">
                            <a class="page-link" href="#"><i class="fas fa-angle-left"></i></a>
                        </li>
                    `);
                }

                // Page Numbers (Show up to 5 pages)
                let startPage = Math.max(1, response.current_page - 2);
                let endPage = Math.min(response.last_page, response.current_page + 2);

                for (let i = startPage; i <= endPage; i++) {
                    if (i === response.current_page) {
                        paginationContainer.append(`
                            <li class="page-item active">
                                <a class="page-link" href="#">${i}</a>
                            </li>
                        `);
                    } else {
                        paginationContainer.append(`
                            <li class="page-item">
                                <a class="page-link" href="#" data-page="${i}">${i}</a>
                            </li>
                        `);
                    }
                }

                // Next Button
                if (response.current_page < response.last_page) {
                    paginationContainer.append(`
                        <li class="page-item">
                            <a class="page-link" href="#" data-page="${response.current_page + 1}">
                                <i class="fas fa-angle-right"></i>
                            </a>
                        </li>
                    `);
                } else {
                    paginationContainer.append(`
                        <li class="page-item disabled">
                            <a class="page-link" href="#"><i class="fas fa-angle-right"></i></a>
                        </li>
                    `);
                }

                // Handle pagination click event
                $('.pagination ul').off('click', '.page-link').on('click', '.page-link', function (e) {
                    e.preventDefault();
                    const page = $(this).data('page');
                    if (page) {
                        loadWebsites(page);
                    }
                });
            }

            // Search & filter event listener
            $('#search_keyword, #status_filter').on('change', function() {
                loadWebsites();
            });
            $(document).on('click', '.pagination .page-link', function(e) {
                e.preventDefault();
                let page = $(this).data('page');
                loadWebsites(page);
            });
            // Load websites on page load
            loadWebsites();
        });
        $(document).on('click', '.copy-link', function () {
            let url = $(this).data('url');

            // Copy to clipboard
            navigator.clipboard.writeText(url).then(() => {
                let icon = $(this);
                icon.attr('title', 'Copied!').tooltip('_fixTitle').tooltip('show');
                
                setTimeout(() => {
                    icon.attr('title', 'Copy to clipboard').tooltip('_fixTitle');
                }, 1500);
            }).catch(err => {
                console.error('Failed to copy:', err);
            });
        });

    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('adminlte::page', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/spion/resources/views/admin/user/website.blade.php ENDPATH**/ ?>